﻿using System;
using UnityEngine;
using UnityEngine.EventSystems;

namespace Valve.VR.InteractionSystem
{
	// Token: 0x02000612 RID: 1554
	public class InputModule : BaseInputModule
	{
		// Token: 0x170004CA RID: 1226
		// (get) Token: 0x06002767 RID: 10087 RVA: 0x000E5FF8 File Offset: 0x000E41F8
		public static InputModule instance
		{
			get
			{
				if (InputModule._instance == null)
				{
					InputModule._instance = UnityEngine.Object.FindObjectOfType<InputModule>();
				}
				return InputModule._instance;
			}
		}

		// Token: 0x06002768 RID: 10088 RVA: 0x000E601C File Offset: 0x000E421C
		public override bool ShouldActivateModule()
		{
			return base.ShouldActivateModule() && this.submitObject != null;
		}

		// Token: 0x06002769 RID: 10089 RVA: 0x000E6038 File Offset: 0x000E4238
		public void HoverBegin(GameObject gameObject)
		{
			PointerEventData eventData = new PointerEventData(base.eventSystem);
			ExecuteEvents.Execute<IPointerEnterHandler>(gameObject, eventData, ExecuteEvents.pointerEnterHandler);
		}

		// Token: 0x0600276A RID: 10090 RVA: 0x000E6060 File Offset: 0x000E4260
		public void HoverEnd(GameObject gameObject)
		{
			ExecuteEvents.Execute<IPointerExitHandler>(gameObject, new PointerEventData(base.eventSystem)
			{
				selectedObject = null
			}, ExecuteEvents.pointerExitHandler);
		}

		// Token: 0x0600276B RID: 10091 RVA: 0x000E6090 File Offset: 0x000E4290
		public void Submit(GameObject gameObject)
		{
			this.submitObject = gameObject;
		}

		// Token: 0x0600276C RID: 10092 RVA: 0x000E609C File Offset: 0x000E429C
		public override void Process()
		{
			if (this.submitObject)
			{
				BaseEventData baseEventData = this.GetBaseEventData();
				baseEventData.selectedObject = this.submitObject;
				ExecuteEvents.Execute<ISubmitHandler>(this.submitObject, baseEventData, ExecuteEvents.submitHandler);
				this.submitObject = null;
			}
		}

		// Token: 0x04002769 RID: 10089
		private GameObject submitObject;

		// Token: 0x0400276A RID: 10090
		private static InputModule _instance;
	}
}
